Mention doc tests with cargo test.
authorSteve Klabnik <steve@steveklabnik.com>
Mon, 27 Jul 2015 18:35:37 +0000 (14:35 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Mon, 27 Jul 2015 18:39:48 +0000 (14:39 -0400)
While doing this, I noticed that the manifest documentation does mention that
'cargo test' tests examples, so this also includes some information about this
in the guide.

Fixes #1177

src/doc/guide.md
src/doc/manifest.md

index fca01ac726d971a668047ff8cb5e0457695f1066..c3b847193d78572f3df794255a768538de0d3fbd 100644 (file)
@@ -408,6 +408,13 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 Of course, if your project has tests, you'll see more output, with the
 correct number of tests.
 
+`cargo test` runs additional tests as well. For example, it will compile any
+examples, you’ve included, and will also test the examples in your
+documentation. Please see the [testing guide][testing] in the Rust
+documentation for more details.
+
+[testing]: https://doc.rust-lang.org/book/testing.html
+
 # Path Dependencies
 
 Over time our `hello_world` project has grown significantly in size! It's gotten
index a49e3a817546853186ed624a906463563d2eb241..e0631bf03fbce9ad2bd9fda30f71e03f22166348 100644 (file)
@@ -439,6 +439,8 @@ When you run `cargo test`, Cargo will:
 
 * Compile your library's unit tests, which are in files reachable from
   `lib.rs`. Any sections marked with `#[cfg(test)]` will be included.
+* Compile your library’s documentation tests, which are embedded inside
+  of documentation blocks.
 * Compile your library's integration tests, which are located in
   `tests`. Files in `tests` load in your library by using `extern crate
   <library-name>` like any other code that depends on it.